package com.xujiang.myblog.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xujiang.myblog.R;
import com.xujiang.myblog.entity.FriendEntity;

import java.util.List;

import jp.wasabeef.glide.transformations.CropCircleTransformation;

/**
 * Created by xujiang on 2017/4/18.
 */

public class FriendFragmentAdapter extends BaseQuickAdapter<FriendEntity,BaseViewHolder> {

    public FriendFragmentAdapter(int layoutResId, List<FriendEntity> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, FriendEntity item) {
        Glide.with(mContext).load(item.getPortraitUrl()).bitmapTransform(new CropCircleTransformation(mContext)).into((ImageView)helper.getView(R.id.Head_portrait_item_rlv_friendfragment));
        helper.setText(R.id.item_name_item_rlv_friendfragment,item.getTitleName());
        helper.setText(R.id.message_item_rlv_friendfragment,item.getMessage());
        helper.setText(R.id.time_item_rlv_friendfragment,item.getTime());
        Glide.with(mContext).load(item.getImageNumberUrl()).bitmapTransform(new CropCircleTransformation(mContext)).into((ImageView)helper.getView(R.id.image_number_item_rlv_friendfragment));
    }


}
